<?php 
class CBaseForums extends CBaseEosPlural {

	public function __construct() {		
		return true;
	}
	
	public static function fetchForums( $objDatabase ) {
		$strSql = 'SELECT * FROM `forums`';
		return parent::fetchResults( $strSql, 'CForum', $objDatabase );
	}
	
	public static function fetchForumsByParentId( $intParentId, $objDatabase ) {
		$strSql = 'SELECT 
						f.* 
					FROM 
						`forums` f
					where f.parent_id = ' . ( int ) $intParentId;
		return parent::fetchResults( $strSql, 'CForum', $objDatabase );
	}
	
	public static function fetchForumById( $intId, $objDatabase ) {
		$strSql = 'SELECT 
						f.* 
					FROM 
						`forums` AS f 
					WHERE 
						f.`id` = ' . $intId;
		return parent::fetchResult( $strSql, 'CForum', $objDatabase );
	}
		
}
?>